import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:omni_datetime_picker/omni_datetime_picker.dart';
import 'package:yuan_hang_app/base/base_state.dart';
import 'package:yuan_hang_app/base/full_base_page.dart';

class TestWidgetPage extends StatefulWidget {
  const TestWidgetPage({super.key});

  @override
  BaseState<TestWidgetPage> createState() => _TestWidgetPageState();
}

class _TestWidgetPageState extends BaseState<TestWidgetPage> {


  @override
  FullBasePage buildState(BuildContext context) {
    return FullBasePage(
        title: "组件测试页面",
        child: Center(
          child: Column(
            children: [
              ElevatedButton(
                onPressed: () async {
                  final DateTime? dateTime =
                  await showOmniDateTimePicker(context: context);

                  // Use dateTime here
                  debugPrint('dateTime: $dateTime');
                },
                child: const Text('Show DateTime Picker'),
              ),
              ElevatedButton(
                onPressed: () async {
                  final List<DateTime>? dateTime =
                  await showOmniDateTimeRangePicker(context: context);

                  // Use dateTime here
                  debugPrint('dateTime: $dateTime');
                },
                child: const Text('Show DateTime Picker'),
              ),
            ],
          ),
        ),
    );
  }
}
